@import "../../../assets/sass/variables";

.free-checkbox {

  position: relative;
  display: inline-flex;
  cursor: pointer;
  align-items: center;

  > input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
  }

  &.free-checkbox-disabled {
    cursor: not-allowed;
    input {
      cursor: not-allowed;
    }
  }

  .free-checkbox-inner,
  .free-checkbox-ins {
    display: flex;
    align-items: center;
  }

  .free-checkbox-title {
    max-width: 10rem;
    white-space: nowrap;
  }

  .free-sr-only .free-checkbox-title {
    display: none;
  }

  .free-checkbox-ins {
    position: relative;
    width: 1rem;
    height: 1rem;
    border-radius: 2px;
    background: rgba(0,0,0,0.26);
  }

  .free-checkbox-ins:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 2px;
  }

  .free-checkbox-ins {
    &:before,
    &:after {
      transform: scale(0);
      transition: all .3s cubic-bezier(.25,.8,.25,1);
    }
  }

  .free-checkbox-ins::after {
    content: "";
    width: 6px;
    height: 13px;
    position: absolute;
    top: 1px;
    left: 8px;
    border: 2px solid #fff;
    border-top: 0;
    border-left: 0;
    opacity: 0;
    transform: rotate(45deg) scale3D(.15,.15,1);;
  }

  >input:checked+.free-checkbox-inner {
    .free-checkbox-ins::after {
      opacity: 1;
      transform: rotate(45deg) scale3D(1,1,1);;
    }

    .free-checkbox-ins:before {
      transform: scale(1);
      background: #333;
    }
  }

  >input:disabled+.free-checkbox-inner {
    .free-checkbox-ins {
      opacity: .8;
    }
  }

  .free-checkbox-inner {
    padding-right: .3rem;
  }
}
